# -*- coding: utf-8 -*-
# Author: xiantingDeng
# Email: dengxianting@shxgroup.net
# Time: 22:47

# 打印功能提示
print("--"*50)
print("名字关系系统，V8.9")
print("1.添加一个新的名字\n2.删除一个名字\n3.修改一个名字\n4.查询一个名字\n5.显示出所有的卡片\n6.退出系统")
print("--"*50)

news = []
while True:
    num = int(input("请输入功能序号："))
    if num == 1:
        new_name = input("请输入新的名字：")
        new_qq = input("请输入新的QQ号：")
        new_weixin = input("请输入新的微信：")
        new_addr = input("请输入新的住址：")

        new_infor = {}
        new_infor["name"] = new_name
        new_infor["qq"] = new_qq
        new_infor["wx"] = new_weixin
        new_infor["addr"] = new_addr
        news.append(new_infor)
    elif num == 2:
        pass
    elif num == 3:
        pass
    elif num == 4:
        find_name = input("请输入你要查询的名字：")
        find_flag = 0
        for temp in news:
            if find_name == temp["name"]:
                print("%s\t%s\t%s\t%s"%(temp['name'],temp["qq"],temp["wx"],temp["addr"]))
                find_flag = 1
                break
        if find_flag == 0:
            print("查无此人！！！")
    elif num == 5:
        print("姓名\tQQ\t微信\t住址")
        for temp in news:
            print("%s\t%s\t%s\t%s" % (temp['name'], temp["qq"], temp["wx"], temp["addr"]))
    elif num == 6:
        break
    else:
        print("输入错误，请重新输入！")
